<?php

class Games_Controller extends Base_Controller {
  
  public $restful = true;
  public $layout = 'layouts.default';

  public function get_games($id) {
    $view = View::make('games.games');
    
    $category = new Category(null, $id);
    $view['categoryId'] = $category->id;
    $this->layout->title = $category->title . ' Games - Yoyo.md';
    $this->layout->content = $view;
  }
  
  public function get_new() {
    $view = View::make('games.new');
    $this->layout->title = 'New Game - Yoyo.md';
    $this->layout->content = $view;
  }
  
  public function post_create() {
    $game = new Game();
    $game->categoryId = Input::get('category');
    $game->name = Input::get('name');
    $game->title = Input::get('title');
    $game->imageId = Input::get('imageId');
    $game->Save();

    return Redirect::to_route('admin');
  }
  
  
}

?>
